<!DOCTYPE html>
<html>
<head>
    <%include("/back/_include/meta.html",{"title":""}){}%>
    <%include("/back/_include/style.html"){}%>
    <link href="/assets/ui/h+/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox">
                <div class="ibox-content">
                    <table id="table"
                           data-classes="table table-hover table-condensed"
                           data-show-columns="true"
                           data-height="700"
                           data-search="true"
                           data-show-refresh="true"
                           data-show-toggle="true"
                    ></table>
                </div>
            </div>
        </div>
    </div>
</div>
<%include("/back/_include/script.html"){}%>
<script src="/assets/ui/h+/js/plugins/bootstrap-table/bootstrap-table.min.js"></script>
<script src="/assets/ui/h+/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
<script type="text/javascript">
    $(function () {
        var $table = $('#table').bootstrapTable({
            url: '/b/site/page',
            pagination: true,
            sidePagination: 'server',
            pageList:[5,10,20,50],
            queryParams: function (params) {
                return params;
            },
            columns: [
                {
                    title: '网站标题',
                    field: 'title',
                }, {
                    title: 'logo',
                    field: 'logo',
                    formatter:function (value,row,index) {
                        return "<img src='"+value+"'>"
                    }
                },  {
                    title: '底部logo',
                    field: 'bottomLogo',
                    formatter:function (value,row,index) {
                        return "<img src='"+value+"'>"
                    }
                }, {
                    title: '网址',
                    field: 'url',
                }, {
                    title: '版权声明',
                    field: 'title',
                }, {
                    title: '固话',
                    field: 'telephone',
                }, {
                    title: '邮箱',
                    field: 'email',
                }, {
                    title: '手机',
                    field: 'mobile',
                }, {
                    title: '二维码',
                    field: 'qrCode',
                    formatter:function (value,row,index) {
                        return "<img src='"+value+"'>"
                    }
                }, {
                    title: '地址',
                    field: 'address',
                }, {
                    title: 'seo关键词',
                    field: 'keyword',
                }, {
                    title: 'seo描述',
                    field: 'description',
                }, {
                    title: 'ip访问限制',
                    field: 'open_ip',
                    formatter: function (value, row, index) {
                        return value===true?"已开启":"已关闭"
                    }
                },{
                    title: '更新时间',
                    field: 'gmtModified',
                    formatter: function (value, row, index) {
                        return timestampToDate(value)
                    }
                }, {
                    title: '操作',
                    formatter: function (value, row, index) {
                        var id = row.pkvalueList[0];
                        return [
                            '<button type="button" data-id="'+id+'" class="edit btn btn-sm btn-info">修改</button>',
                        ].join(' ');
                    }
                }
            ]
        });
        //编辑
        $(document).on("click",'.edit',function () {
            layer.open({
                type: 2,
                title: '编辑系统',
                shadeClose: true,
                shade: 0.2,
                area: ['900px', '98%'],
                content: '/b/site/edit?id='+$(this).data("id")
            });
        })
    });
</script>
</body>
</html>
